package com.lxl.service.impl;

import java.util.List;

import com.lxl.dao.BookDao;
import com.lxl.dao.impl.BookDaoImpl;
import com.lxl.model.Book;
import com.lxl.service.BookService;

/**
 * @author 刘星鹭
 * @Email liuxinglumail@163.com
 * @version 创建时间： 2014年9月12日 下午3:51:58
 */

public class BookServiceImpl implements BookService {

	@Override
	public void persist(Book book) { // 以下为CRUD方法
		BookDao bookDao = new BookDaoImpl();
		bookDao.persist(book);

	}

	@Override
	public void delete(Integer bookNo) {
		BookDao bookDao = new BookDaoImpl();
		bookDao.delete(bookNo);
	}

	@Override
	public void merge(Integer oldBookNo, Book newBook) {
		BookDao bookDao = new BookDaoImpl();
		bookDao.merge(oldBookNo, newBook);
	}

	@Override
	public Book get(Integer bookNo) {
		BookDao bookDao = new BookDaoImpl();
		return bookDao.get(bookNo);
	}

	@Override
	public List<Book> list() {
		BookDao bookDao = new BookDaoImpl();
		return bookDao.list();
	}
}
